package com.liang.demo.controller;

import com.liang.demo.base.RestResponse;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈琪亮
 * @version 1.0
 * @date 2021/3/21 15:01
 */
@RestController
@RequiresRoles(value = {"商品管理员", "超级管理员"},logical=Logical.OR)
public class GoodsController {

    //品牌管理
    @RequiresPermissions(value = {"brand:*"})
    @GetMapping("/api/goods/brand")
    public RestResponse<String> brandManager() {
        return RestResponse.ok("品牌管理");
    }

    //商品管理
    @RequiresPermissions(value = {"product:*"})
    @GetMapping("/api/goods/product")
    public RestResponse<String> productManager() {
        return RestResponse.ok("商品管理");
    }

    //商品属性管理
    @RequiresPermissions(value = {"productAttribute:*"})
    @GetMapping("/api/goods/productAttribute")
    public RestResponse<String> productAttributeManager() {
        return RestResponse.ok("商品属性管理");
    }
}
